home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / PCI Driver Development Kit / • Tools / Utility / PCISlots / SCMBuild < prev   
Encoding:
Text File  |  1996-08-20  |  5.9 KB  |  176 lines  |  [TEXT/MPS ]

  1. # Copyright © 1995 by Apple Computer, Inc.  All rights reserved.
  2. # SCMBuild
  3. #
  4. #FILE
  5. #    SCMBuild
  6. #
  7. #NAME
  8. #    PCI Slot Peek build script
  9. #
  10. #DESCRIPTION
  11. #    This MPW Build file contains MPW Shell instructions to build
  12. #    the PCI Slot Peek application.
  13. #
  14. #MODIFICATION HISTORY
  15. #    Created by Terry Teague
  16. #
  17. #    20 Apr 95    -    TRT    -    Initial version
  18. #    17 Jul 95    -    TRT    -    Tidy-up source for PPCC v1.0.5, Universal Headers v2.0 final,
  19. #                                    CodeWarrior 6.1.
  20. #
  21. #=============================================================================================
  22. #
  23.  
  24. Set StartTime                    `Date -n`
  25. Echo "# Started PCISlots build at : `Date -t`"
  26.  
  27. #=============================================================================================
  28. # Available options for this script (usage string)
  29. #=============================================================================================
  30.  
  31. Set UsageString "∂
  32. SCMBuild                # Build PCI Slot Peek application∂n∂
  33. SCMBuild [option…]∂n∂
  34.     -H[elp]             # Show this help messge∂n∂
  35.     -68K                # make a 68K only version∂n∂
  36.     -PPC                # make a PPC only version (default)∂n∂
  37.     -FAT                # make both 68K and PPC versions∂n∂
  38.     -sprintf            # use alternate sprintf/vprintf library∂n∂
  39.     -MPW                # use MPW as the development system (default)∂n∂
  40.     -MW                 # use MetroWerks as the development system [not implemented yet]∂n∂
  41.     -SC                 # use Symantec as the development system [not implemented yet]∂n∂
  42.     -noUni              # don't use Universal Headers (implies 68K only)∂n∂
  43.     -UniV1              # use Universal Headers v1.0 (default)∂n∂
  44.     -UniV2              # use Universal Headers v2.0∂n∂
  45. "
  46.  
  47. #=============================================================================================
  48. # Final names of products
  49. #=============================================================================================
  50.  
  51. Set BaseName            PCISlots
  52.  
  53. #=============================================================================================
  54. # Assume no script input parameters - set Shell variables to default options
  55. #=============================================================================================
  56.  
  57. Set BuildName            {BaseName}
  58. Set Build68K            {BaseName}.68K
  59. Set BuildPPC            {BaseName}.PPC
  60.  
  61. Set 68K_sprintfLib    ""
  62. Set PPC_sprintfLib    ""
  63.  
  64. # work around some difficulties with passing the Object folder names to Make
  65. Set 68K_Objects        :68K_Objects:
  66. Set PPC_Objects        :PPC_Objects:
  67.  
  68. Set newParams            ""
  69. Set ShowHelpOnly        0
  70.  
  71. Set OtherMakeOptions    ""
  72. Set PreUniHeaders        "-d qPreUniHeaders=0"    #set to 0 for Universal Headers
  73.  
  74. # PPC (only) by default
  75.  
  76. Set BuildOptions         "-d Build68K="
  77. Set Build68K            ""
  78.  
  79. #=============================================================================================
  80. # Echo the command
  81. #=============================================================================================
  82.  
  83. Open "{WorkSheet}"
  84. Echo "∂n{0} {Parameters}"
  85.  
  86. #=============================================================================================
  87. # Process the script parameters
  88. #=============================================================================================
  89.  
  90. For x in {"parameters"}
  91.     If "{x}" =~ /-H(elp)«0,1»/
  92.         Set ShowHelpOnly        1
  93.     Else If "{x}" =~ /-68K/
  94.         Set BuildOptions         "-d BuildPPC="
  95.         Set BuildPPC            ""
  96.     Else If "{x}" =~ /-PPC/
  97.         Set BuildOptions         "-d Build68K="
  98.         Set Build68K            ""
  99.     Else If "{x}" =~ /-FAT/
  100.         Set BuildOptions         ""
  101.         Set Build68K            {BaseName}.68K
  102.         Set BuildPPC            {BaseName}.PPC
  103.     Else If "{x}" =~ /-sprintf/
  104.         Set 68K_sprintfLib    "{68K_Objects}altsprintf.c.68K.o"
  105.         Set PPC_sprintfLib    "{PPC_Objects}altsprintf.c.PPC.o"
  106.     Else If "{x}" =~ /-NoUni/
  107.         Set PreUniHeaders        "-d qPreUniHeaders=1"    #set to 1 for pre-Universal Headers
  108.         Set PPCCIncludes        "{CIncludes}"
  109.         Set BuildOptions         "-d BuildPPC="
  110.         Set BuildPPC            ""
  111.     Else If "{x}" =~ /-UniV1/
  112.         Set PreUniHeaders        "-d qPreUniHeaders=0 -d qUniHeadersV1=1"    #set to 0 for Universal Headers
  113.     Else If "{x}" =~ /-UniV2/
  114.         Set PreUniHeaders        "-d qPreUniHeaders=0 -d qUniHeadersV2=1"    #set to 0 for Universal Headers
  115.     Else
  116.         Set newParams "{newParams} {x}"
  117.     End
  118. End
  119.  
  120. #=============================================================================================
  121. # Handle error conditions in script parameters, and handle help
  122. #=============================================================================================
  123.  
  124. If {ShowHelpOnly}
  125.     Echo "{UsageString}" > Dev:StdOut
  126.     Exit 0
  127. End
  128.  
  129. #=============================================================================================
  130. # Build it
  131. #=============================================================================================
  132.  
  133. If ("{Build68K}" == "") And ("{BuildPPC}" == "")
  134. # build both
  135.     Set Build68K            {BaseName}.68K
  136.     Set BuildPPC            {BaseName}.PPC
  137. End
  138.  
  139. # Options to pass to the C/C++ compilers
  140.  
  141. #Set OtherCOptions "-d OtherCOptions='-d qEndUser=1'"
  142.  
  143. # Options to pass to Make
  144. # To turn on Macsbug symbol, use -d MacsBug=full.  SADE symbols, -d Symbols=full.
  145. # Or you can pass the option from the command line, eg., scmbuild -d Macsbug=full
  146.  
  147. #Set OtherMakeOptions "-d RezOptions='-d qEndUser=1'"
  148.  
  149. Set OtherMakeOptions "{BuildOptions} -d PreUniHeaders=∂'{PreUniHeaders}∂' -d 68K_sprintfLib={68K_sprintfLib} -d PPC_sprintfLib={PPC_sprintfLib}"
  150.  
  151. If Not "`Exists -d {68K_Objects}`"
  152.     NewFolder "{68K_Objects}"
  153. End
  154.  
  155. If Not "`Exists -d {PPC_Objects}`"
  156.     NewFolder "{PPC_Objects}"
  157. End
  158.  
  159. Echo    -n    "#--->"
  160. Echo    "::building {BuildName} using {Build68K} {BuildPPC}"
  161.  
  162. BuildProgram "{BuildName}" {OtherCOptions} {OtherMakeOptions} {newParams}
  163.  
  164. #=============================================================================================
  165. # Clean up and exit
  166. #=============================================================================================
  167.  
  168. #Directory "{SavedDirectory}"
  169.  
  170. Set EndTime                        `Date -n`
  171. Set BuildTime                    `Evaluate {EndTime} - {StartTime}`
  172. Set minutes                        `Evaluate {BuildTime} ÷ 60`
  173. Set seconds                        `Evaluate {BuildTime} - ({minutes} * 60)`
  174.  
  175. Echo "# Build Time:  {minutes} minutes {seconds} seconds"
  176.